#pragma once

#include "d3d9.h"
#include "d3dx9.h"
#include <stdio.h>		// required for sprintf_s
#include "SpriteManager.h"

#pragma comment (lib, "d3d9.lib")
#pragma comment (lib, "d3dx9.lib")
#pragma comment (lib, "winmm.lib")


class PowerBar
{
private:
	// Pointer to SpriteManager
	SpriteManager*		m_pSpriteManager;

	// Singleton instance
	static PowerBar*	m_PowerBarInstance;

	short sPowerBarFull;
	short sPowerBar1;
	short sPowerBar2;
	short sPowerBar3;
	short sPowerBar4;
	short sPowerBar5;
	short sPowerBar6;
	short sPowerBarEmpty;
	// Variable for the checkpoint
	short sCheckpointPower;

	int		iPowerLevel;  // internal power bar tracker
	short	sPowerBarGuage; //saves sprite that we want to render

public:
	PowerBar(void);
	~PowerBar(void);
	
	// Singleton functions
	static PowerBar* GetInstance(void);
	void DeletePowerBarInstance(void);

	void Initialize(void);
	void LoadPowerBar(void);
	void Update();
	int  CheckPowerLevel();
	void ChangePowerLevel(int iPowerChange);
	void ResetPower();
	void SetCheckpoint(void);
	void FullPower();
	void Render(void);

	// Shutdown
	void DestroyPower(void);
};
